import * as sdk from './fetch';

/**
 *
 * 权益相关
 *
 */
// 查询类目
async function findOnecategoryList(request = {}) {
  let result = await sdk.post<BaseResponseMapStringString>('/onecategory/list', {
    ...request,
  });
  return result.context;
}
//新增预约白鲸鱼订单
async function whaleorderAdd(request) {
  let result = await sdk.post<BaseResponseMapStringString>('/whaleorder/add', {
    ...request,
  });
  return result;
}
//修改白鲸鱼订单
async function whaleorderEdit(request) {
  let result = await sdk.put<BaseResponseMapStringString>('/whaleorder/modify', {
    ...request,
  });
  return result;
}
//查询白鲸鱼订单
async function findWhaleorderOrder(request) {
  let result = await sdk.post<BaseResponseMapStringString>('/whaleorder/page', {
    ...request,
  });
  return result;
}
//查询白鲸鱼订单详情
async function getWhaleOrderId(orderId) {
  let result = await sdk.get<BaseResponseMapStringString>(`/whaleorder/${orderId}`, {});
  return result;
}
//取消白鲸鱼订单
async function cancelWhaleorder(request) {
  let result = await sdk.post<BaseResponseMapStringString>('/whaleorder/cancel', {
    ...request,
  });
  return result;
}


export default {
  findOnecategoryList,
  whaleorderAdd,
  findWhaleorderOrder,
  getWhaleOrderId,
  whaleorderEdit,
  cancelWhaleorder,
};

/**
 * 内容
 */
export interface BaseResponseMapStringString {
  /**
   * 结果码
   */
  code: string;
  /**
   * 内容
   */
  context?: {
    [k: string]: string;
  };
  /**
   * 错误内容
   */
  errorData?: {
    [k: string]: any;
  };
  /**
   * 消息内容
   */
  message?: string;
  /**
   * 分页
   */
  totalPages: number;
  /**
   * 数据
   */
  content: any;
}

/**
 * This interface was referenced by `IgnoreType`'s JSON-Schema
 * via the `definition` "IGetSignRequestReq".
 */
export interface IGetSignRequestReq {
  url?: string;
  [k: string]: any;
}

//create by moon https://github.com/creasy2010/moon
